import request from '@/utils/request'

/**
 * 新增部门
 * @params {code,introduce,manager,name,pid}  data
 * @returns
 */
export const addDepartments = (data) => request.post('/company/department', data)

/**
 * 获取部门列表
 *
 * @returns
 */
export const getDepartments = () => request.get('/company/department')

/**
 * 修改部门详情
 * @params {code,introduce,manager,name,pid,id}  data
 * @returns
 */
export const updateDepartments = (data) => request.put(`/company/department/${data.id}`, data)

/**
 * 删除部门
 *
 * @returns
 */
export const delDepartments = (id) => request.delete(`/company/department/${id}`)

/**
 * 获取部门详情
 *
 * @returns
 */
export const getDepartmentsDetail = (id) => request.get(`/company/department/${id}`)
